//
//  LTCSingleHud.m
//  LightCiy
//
//  Created by 郑信鸿 on 2017/8/20.
//  Copyright © 2017年 lightciy.com. All rights reserved.
//

#import "LTCSingleHud.h"
#import "SVProgressHUD.h"

@implementation LTCSingleHud


+ (void)configeHudAppearance{
    //配置hud的外形
    [SVProgressHUD setInfoImage:nil];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
}



+ (void)showLoading:(NSString *)loading{
    
    [SVProgressHUD showWithStatus:loading];
}


+ (void)hideHud{
    
    [SVProgressHUD dismiss];
}

+ (void)showErrorMessage:(NSString *)message{
    
    [self showErrorMessage:message completion:nil];
    
}

+ (void)showErrorMessage:(NSString *)message completion:(void(^)(void))completion{
    
    [SVProgressHUD showErrorWithStatus:message];
    [self hudDelayHidCompletion:completion];
    
}

+ (void)showSuccessMessage:(NSString *)message{
    
    [self showMessage:message completion:nil];

}

+ (void)showSuccessMessage:(NSString *)message completion:(void(^)(void))completion{
    [SVProgressHUD showSuccessWithStatus:message];
    [self hudDelayHidCompletion:completion];
}

+ (void)showMessage:(NSString *)message completion:(void(^)(void))completion{
    
    [SVProgressHUD showInfoWithStatus:message];
    
    [self hudDelayHidCompletion:completion];
}


+ (void)hudDelayHidCompletion:(void(^)(void))completion{
    
    [SVProgressHUD dismissWithDelay:1.5 completion:completion];
    
}

+ (void)showMessage:(NSString *)message{
    
    [self showMessage:message completion:nil];
}

@end
